<?php

/**
 * Element Helper
 * Helps creating embeded youtube object from the youtube url
 *
 */

class ElementHelper extends AppHelper {
	var $helpers = array('Html');
    function youTubeVideo($str){
		//if (instring
        $tempt=explode('=',$str);
		$var="";
		if (count($tempt)>1) {
			$var=$tempt[1];
		}
        $returnStr="
		<object width=\"320\" height=\"265\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$var."&hl=en&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/".$var."&hl=en&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"320\" height=\"265\"></embed></object>";
        return $returnStr;
    }
}

?>